﻿namespace Kise.LprCapturer
{
    /*
typedef unsigned short ushort;
typedef unsigned long ulong;
typedef unsigned char unchar;

struct Header {

    ushort width;		
    ushort height;		
    
    ushort bits;  	
    ushort format;		
    
    ushort frame_type; 	
    ushort frame_rev;	
    
    ulong  firmware_version;
    ulong  device_no;
    
    ulong  len;
    
    ulong  speed;
    ulong  rs232;

    ushort year;
    ushort month; 
    ushort day; 
    ushort hour; 
    ushort minute; 
    ushort second; 
    
    ulong ip; 
    ulong frame_count;	
    ulong trigger_count; 
    ulong trigger_index;
    ulong frame_no;
    
    ulong gain;			
    ulong time;			
    ulong gain_r, gain_g, gain_b; 

    ulong mode;
    ulong JpegQ;	

    ushort year2; 
    ushort month2; 
    ushort day2; 
    ushort hour2; 

    ulong trig_chl;
    ulong msecond;

    ulong msecond2;

    ulong mpeg_head;
    ushort img_num;
    ushort plate_num;
    
    ushort h264width;
    ushort h264height;
    ulong h264_len;
    ushort minute2; 
    ushort second2;
    ushort rev[3];
    ushort vehicle_speed;
    ulong jpeg_len2;
    ulong jpeg_len;
    
    unchar user_info[32];
    char plate1[16];
    char plate2[16];
};
    */


    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential, CharSet = System.Runtime.InteropServices.CharSet.Ansi)]
    public struct Header
    {

        /// ushort->unsigned short
        public ushort width;

        /// ushort->unsigned short
        public ushort height;

        /// ushort->unsigned short
        public ushort bits;

        /// ushort->unsigned short
        public ushort format;

        /// ushort->unsigned short
        public ushort frame_type;

        /// ushort->unsigned short
        public ushort frame_rev;

        /// ulong->unsigned int
        public uint firmware_version;

        /// ulong->unsigned int
        public uint device_no; //设备id

        /// ulong->unsigned int
        public uint len;

        /// ulong->unsigned int
        public uint speed;

        /// ulong->unsigned int
        public uint rs232;

        /// ushort->unsigned short
        public ushort year;

        /// ushort->unsigned short
        public ushort month;

        /// ushort->unsigned short
        public ushort day;

        /// ushort->unsigned short
        public ushort hour;

        /// ushort->unsigned short
        public ushort minute;

        /// ushort->unsigned short
        public ushort second;

        /// ulong->unsigned int
        public uint ip;

        /// ulong->unsigned int
        public uint frame_count;

        /// ulong->unsigned int
        public uint trigger_count;

        /// ulong->unsigned int
        public uint trigger_index;

        /// ulong->unsigned int
        public uint frame_no;

        /// ulong->unsigned int
        public uint gain;

        /// ulong->unsigned int
        public uint time;

        /// ulong->unsigned int
        public uint gain_r;

        /// ulong->unsigned int
        public uint gain_g;

        /// ulong->unsigned int
        public uint gain_b;

        /// ulong->unsigned int
        public uint mode;

        /// ulong->unsigned int
        public uint JpegQ;

        /// ushort->unsigned short
        public ushort year2;

        /// ushort->unsigned short
        public ushort month2;

        /// ushort->unsigned short
        public ushort day2;

        /// ushort->unsigned short
        public ushort hour2;

        /// ulong->unsigned int
        public uint trig_chl;

        /// ulong->unsigned int
        public uint msecond;

        /// ulong->unsigned int
        public uint msecond2;

        /// ulong->unsigned int
        public uint mpeg_head;

        /// ushort->unsigned short
        public ushort img_num;   //图片数目

        /// ushort->unsigned short
        public ushort plate_num; //车牌数目

        /// ushort->unsigned short
        public ushort h264width;

        /// ushort->unsigned short
        public ushort h264height;

        /// ulong->unsigned int
        public uint h264_len; //视频长度

        /// ushort->unsigned short
        public ushort minute2;

        /// ushort->unsigned short
        public ushort second2;

        /// ushort[3]
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = System.Runtime.InteropServices.UnmanagedType.U2)]
        public ushort[] rev;

        public ushort speed_limit; //限速值

        /// ushort->unsigned short
        public ushort vehicle_speed; //车速

        /// ulong->unsigned int
        public uint jpeg_len2;

        /// ulong->unsigned int
        public uint jpeg_len;

        /// unchar[32]
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 32)]
        public string user_info;

        /// char[16]
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 16)]
        public string plate1;

        /// char[16]
        [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 16)]
        public string plate2;
    }

}
